home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 176-200 / 183 / mklib / edlib / hextoint.c < prev    next >
C/C++ Source or Header  |  1995-03-13  |  374b  |  19 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. /* this function takes a string of hex digits and returns its value */
  3. #include <ctype.h>
  4.  
  5. int hextoint(number)
  6. char *number;
  7. {
  8.     int value = 0;
  9.  
  10.     while ( *number )
  11.         if ( isxdigit(*number) ) {
  12.             value = ( value << 4 )  + toint(*number++);
  13.         } else {
  14.             return(value);
  15.         }
  16.  
  17.     return(value);
  18. }
  19.